package exception;

public class expetionThrowAndThrows {

    public static void main(String[] args) {

        test();
    }

    public static void fun() throws ArrayIndexOutOfBoundsException {
        int[] arr = {1, 2, 3};
        System.out.println(arr[100]);
    }

    public static void test() throws ArrayIndexOutOfBoundsException {
        int[] arr = {1, 2, 3};
        System.out.println(arr[1]);
        throw new NullPointerException("抛出个异常玩玩！！！");
    }
}